<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>设置</title>
    <style>
        /* 主题样式 */
        body.theme-light {
            background-color: #f5f5f5;
            color: #333;
        }
        body.theme-light .container {
            background-color: white;
            box-shadow: 0 0 10px rgba(0,0,0,0.1);
        }
        body.theme-light .form-group {
            background-color: #f9f9f9;
        }
        
        body.theme-dark {
            background-color: #333;
            color: #f5f5f5;
        }
        body.theme-dark .container {
            background-color: #444;
            box-shadow: 0 0 10px rgba(0,0,0,0.3);
        }
        body.theme-dark .form-group {
            background-color: #2a2a2a;
        }
        
        /* 字体大小 */
        body.font-small {
            font-size: 14px;
        }
        body.font-medium {
            font-size: 16px;
        }
        body.font-large {
            font-size: 18px;
        }
        
        /* 通用样式 */
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 20px;
            transition: background-color 0.3s, color 0.3s;
        }
        .container {
            max-width: 800px;
            margin: 0 auto;
            padding: 20px;
            border-radius: 8px;
        }
        .header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            border-bottom: 1px solid #eee;
            padding-bottom: 10px;
        }
        body.theme-dark .header {
            border-bottom: 1px solid #555;
        }
        .header h1 {
            margin: 0;
            color: inherit;
        }
        .btn {
            padding: 8px 16px;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            text-decoration: none;
            font-size: 14px;
        }
        body.theme-light .btn {
            background-color: #4285F4;
        }
        body.theme-light .btn:hover {
            background-color: #3367D6;
        }
        body.theme-dark .btn {
            background-color: #1a73e8;
        }
        body.theme-dark .btn:hover {
            background-color: #0d62d9;
        }
        .btn-back {
            background-color: #f1f1f1;
            color: #333;
        }
        body.theme-light .btn-back:hover {
            background-color: #e1e1e1;
        }
        body.theme-dark .btn-back {
            background-color: #555;
            color: #fff;
        }
        body.theme-dark .btn-back:hover {
            background-color: #666;
        }
        .settings-form {
            margin-top: 20px;
        }
        .form-group {
            margin-bottom: 20px;
            padding: 15px;
            border-radius: 6px;
        }
        .form-group h3 {
            margin-top: 0;
            color: inherit;
        }
        .setting-options {
            display: flex;
            flex-wrap: wrap;
            gap: 15px;
        }
        .option-item {
            display: flex;
            flex-direction: column;
            min-width: 150px;
        }
        label {
            margin-bottom: 5px;
            font-weight: bold;
            color: inherit;
        }
        select, input[type="checkbox"] {
            padding: 8px;
            border: 1px solid #ddd;
            border-radius: 4px;
            background-color: transparent;
            color: inherit;
        }
        body.theme-dark select, body.theme-dark input[type="checkbox"] {
            border: 1px solid #666;
        }
        .checkbox-container {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .form-footer {
            margin-top: 20px;
            text-align: right;
        }
        .btn-save {
            padding: 10px 20px;
            background-color: #34A853;
            font-size: 16px;
        }
        .btn-save:hover {
            background-color: #2E8B47;
        }
    </style>
</head>
<body class="{{ body_classes }}">
    <div class="container">
        <div class="header">
            <h1>系统设置</h1>
            <a href="/welcome" class="btn btn-back">返回首页</a>
        </div>
        
        <form action="/update-settings" method="post" class="settings-form">
            <!-- 主题设置 -->
            <div class="form-group">
                <h3>主题设置</h3>
                <div class="setting-options">
                    <div class="option-item">
                        <label>
                            <input type="radio" name="theme" value="light" 
                                {% if settings.theme == "light" %}checked{% endif %}>
                            浅色模式
                        </label>
                    </div>
                    <div class="option-item">
                        <label>
                            <input type="radio" name="theme" value="dark" 
                                {% if settings.theme == "dark" %}checked{% endif %}>
                            深色模式
                        </label>
                    </div>
                </div>
            </div>
            
            <!-- 通知设置 -->
            <div class="form-group">
                <h3>通知设置</h3>
                <div class="setting-options">
                    <div class="option-item">
                        <div class="checkbox-container">
                            <input type="checkbox" id="notifications" name="notifications" 
                                {% if settings.notifications %}checked{% endif %}>
                            <label for="notifications">启用通知</label>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- 语言设置 -->
            <div class="form-group">
                <h3>语言设置</h3>
                <div class="setting-options">
                    <div class="option-item">
                        <label for="language">选择语言:</label>
                        <select id="language" name="language">
                            <option value="zh" {% if settings.language == "zh" %}selected{% endif %}>中文</option>
                            <option value="en" {% if settings.language == "en" %}selected{% endif %}>English</option>
                            <option value="jp" {% if settings.language == "jp" %}selected{% endif %}>日本語</option>
                        </select>
                    </div>
                </div>
            </div>
            
            <!-- 字体大小 -->
            <div class="form-group">
                <h3>显示设置</h3>
                <div class="setting-options">
                    <div class="option-item">
                        <label for="font_size">字体大小:</label>
                        <select id="font_size" name="font_size">
                            <option value="small" {% if settings.font_size == "small" %}selected{% endif %}>小</option>
                            <option value="medium" {% if settings.font_size == "medium" %}selected{% endif %}>中</option>
                            <option value="large" {% if settings.font_size == "large" %}selected{% endif %}>大</option>
                        </select>
                    </div>
                </div>
            </div>
            
            <div class="form-footer">
                <button type="submit" class="btn btn-save">保存设置</button>
            </div>
        </form>
    </div>
</body>
</html>